package com.qc.sys.common;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class TreeNode {

    private Integer id;
    private Integer pid;
    private String title;
    private String icon;
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private String href;
    private Boolean spread;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String target;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String typecode;
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<TreeNode> child = new ArrayList<TreeNode>();

    private String checkArr = "0";  //0代表不选中，1代表选中

    /**
     * 构造菜单
     */
    public TreeNode(Integer id, Integer pid, String title, String icon, String href, Boolean spread, String target,String typecode) {
        this.id = id;
        this.pid = pid;
        this.title = title;
        this.icon = icon;
        this.href = href;
        this.spread = spread;
        this.target = target;
        this.typecode = typecode;
    }
}
